<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\12\17 0017
 * Time: 16:59
 */

namespace App\Controllers;

use App\Models\Data\UserData;
use Swoft\App;
use Swoft\Event\AppEvent;
use Swoft\Http\Server\Bean\Annotation\Controller;
use Swoft\Http\Server\Bean\Annotation\RequestMapping;
use Swoft\Bean\Annotation\Inject;
use Swoft\Auth\Middleware\AclMiddleware;
use Swoft\Http\Message\Bean\Annotation\Middleware;

/**
 * @Middleware(AclMiddleware::class)
 * Class TestController
 * @package App\Controllers
 * @Controller(prefix="/test")
 */
class TestController
{
    /**
    * @Inject()
    * @var UserData
    */
     private $userData;
    /**
     * @RequestMapping("/test/index")
     * @return array
     */
    public function index()
    {
        App::trigger('first_test');
        return $this->userData->getUserInfo();
    }
}